// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
// jsdoc语法提示教程：https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129
module.exports = {
	_before: function () { // 通用预处理器

	},
	// 原创作者管理 ny-authorship-user
	// 获取原创作者
	async getauthorshipUser(item) {
		const db = uniCloud.database();
		const collection = db.collection("ny-authorship-user");
		let res
		if (item != '') {
			res = await collection.where({
				'_id': item
			}).get()
		} else {
			res = await collection.get()
		}
		return {
			code: 200,
			msg: '查询成功',
			data: res
		}
	},
	//原创作者登录
	async loginAuthors(item){
		const db = uniCloud.database();
		const collection = db.collection("ny-authorship-user");
		let res = await collection.where(item).get()
		return {
			code: 200,
			msg: '查询成功',
			data: res.data
		}
	}
}
